﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace QuanLiSinhVienThucTap
{
    public partial class QLDIEM : DevComponents.DotNetBar.Metro.MetroForm
    {
        public QLDIEM()
        {
            InitializeComponent();
        }

        private void QLDIEM_Load(object sender, EventArgs e)
        {
            dataDiemTT.DataSource = XuliLenh.dulieusinhvien("DIEM");
        }

        private void tabControlPanel1_Click(object sender, EventArgs e)
        {

        }

        private void superTabControlPanel1_Click(object sender, EventArgs e)
        {

        }

        private void bttimSV_Click(object sender, EventArgs e)
        {
            //dataDiemTT.DataSource = XuliLenh.loctimmasvdiem("diem", txttimmaSVdiem.Text.ToString());
           // int txtdiemtu = float.Parse(Console.ReadLine());
            if (float.Parse(txtdiemtu.Text) >= 0 && float.Parse(txtdiemden.Text)<= 10)
            {
                dataDiemTT.DataSource = XuliLenh.loctimkhoangdiem("diem",txtdiemtu.Text,txtdiemden.Text);
            }
            else
            {
                MessageBox.Show("không tìm thấy");
            }
        }

        private void label11_Click(object sender, EventArgs e)
        {

        }

        private void dataDiemTT_SelectionChanged(object sender, EventArgs e)
        {
            DataGridViewSelectedRowCollection hangchon = dataDiemTT.SelectedRows;
            if (hangchon.Count > 0 && hangchon.Count < 2)
            {
                DataGridViewRow chonhang = hangchon[0];
                txtMSV.Text = chonhang.Cells["masv"].Value.ToString();
                txtlanTH.Text = chonhang.Cells["lantt"].Value.ToString();
                txtdiem.Text = chonhang.Cells["diem"].Value.ToString();
                txtghichudiem.Text = chonhang.Cells["ghichu"].Value.ToString();
                dttimett.Value = DateTime.Parse(chonhang.Cells["tgthuctap"].Value.ToString());
            }
        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void txtlanTH_TextChanged(object sender, EventArgs e)
        {

        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void txtdiemtu_TextChanged(object sender, EventArgs e)
        {

        }

        private void btTHOAT_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}